<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->

<div class="aui-gutter-column-lg" [innerHTML]="message | i18n">
</div>

<div class="aui-gutter-column-md">
    <lv-datatable [lvData]='data' lvSelectionMode='multiple' [lvSelection]='selection'
        (lvSelectionChange)="selectionChange($event)" lvCompareWith="uuid" #lvTable [lvPaginator]='page' lvSize="small"
        [lvScroll]='{y: "240px"}' lvResize>
        <thead>
            <tr>
                <th lvShowCheckbox width='64px' [lvRowsData]='lvTable.renderData'></th>
                <ng-container *ngFor="let col of columns">
                    <th [lvShowFilter]="col.filter" (lvFilterChange)="filterChange($event)"
                        [(lvFilters)]="col.filterMap" lvCellKey="{{ col.key }}" lvFilterCheckAll>
                        {{ col.label}}
                    </th>
                </ng-container>
            </tr>
        </thead>
        <tbody>
            <ng-container *ngFor='let item of lvTable.renderData'>
                <tr>
                    <td lvShowCheckbox [lvRowData]='item' width='64px'></td>
                    <ng-container *ngFor="let col of columns">
                        <td>
                            <span lv-overflow>
                                {{item[col.key] | nil}}
                            </span>
                        </td>
                    </ng-container>
                </tr>
            </ng-container>
        </tbody>
    </lv-datatable>
    <lv-paginator [hidden]='!data.length' #page lvMode='simple' [lvShowPageSizeOptions]="false" lvPageSize='10'
        [lvTotal]='data.length'></lv-paginator>
</div>

<label lv-checkbox [(ngModel)]="status" (ngModelChange)="checkboxModelChange($event)" *ngIf="!!data.length">
    {{'common_warning_confirm_label' | i18n}}
</label>
